package com.crt.uav.rabbitmq.consumer.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.crt.uav.Constants;
import com.crt.uav.rabbitmq.consumer.AbstractExtChannelAwareMessageListener;

@Component
public class UavInspectionPhotoMessageListener extends AbstractExtChannelAwareMessageListener {

    //巡检图片下载进度
    private String queueName = "uav.inspection.photo.queue";

    private String persistFlag = Constants.PERSISTFLAG_YES;

    // @Autowired(required = false)
    // @Qualifier("thRabbitMqTemplate")
    // private RabbitTemplate thRabbitMqTemplate;

    private static final Logger LOGGER = LoggerFactory.getLogger(UavInspectionPhotoMessageListener.class);

    // @Override
    // protected void handleMessage(Message message, Channel channel) {
    //     // 这里可以添加处理逻辑，例如解析消息内容、存储到数据库等
    //     thRabbitMqTemplate.convertAndSend(message.getMessageProperties().getReceivedExchange(),
    //             message.getMessageProperties().getReceivedRoutingKey(), message.getBody());
    //     LOGGER.info("消息发送成功，Exchange: {}, RoutingKey: {}, Body: {}",
    //             message.getMessageProperties().getReceivedExchange(),
    //             message.getMessageProperties().getReceivedRoutingKey(),
    //             new String(message.getBody()));
    // }

    @Override
    public String getQueueName() {
        return queueName;
    }

    public String getPersistFlag() {
        return persistFlag;
    }
}
